<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="language" content="en"/>
    <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    <?php
    Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/main.css');
    Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/nexttv.css');
    Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/daterangepicker.css');
    Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/bootstrap-select.min.css');
    Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/dist/css/bootstrap-colorpicker.css');
    Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/js/moment.min.js");
    Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/js/daterangepicker.js");
    Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/js/bootstrap-select.min.js");
    Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/js/app.js");
    Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/js/dist/js/bootstrap-colorpicker.js");
    ?>
</head>
<body>
<div class="banner">
    <div class="banner-logo"></div>
    <div class="banner-menu">
        <?php
        $bannerMenus = Yii::app()->menu->getMenu(Menu::TYPE_BANNER);
        $this->widget('bootstrap.widgets.TbMenu', array(
            'type' => 'pills',
            'items' => $bannerMenus,
            'encodeLabel' => false,
        ));
        ?>
    </div>
    <div class="banner-info">
        <div class="banner-info-user"><?php echo Yii::app()->user->name; ?></div>
        <div class="btn-group">
            <?php
            echo CHtml::link('<i class="fa fa-user"></i>', '#', array('class' => 'btn dropdown-toggle', 'data-toggle' => 'dropdown'));
            //echo CHtml::link('<i class="fa fa-user"></i>'.Yii::app()->user->name,'#',array('class'=>'btn dropdown-toggle','data-toggle'=>'dropdown'));
            $topMenus = Yii::app()->menu->getMenu(Menu::TYPE_TOP);
            if (!empty($topMenus)) {
                $this->widget('zii.widgets.CMenu', array(
                    'items' => $topMenus,
                    'htmlOptions' => array('class' => 'dropdown-menu'),
                ));
            }
            ?>
        </div>
    </div>
</div>
<?php
$this->widget('bootstrap.widgets.TbBreadcrumbs', array(
    'links' => $this->breadcrumbs,
    'htmlOptions' => array('class' => ''),
));
?>
<div class="content container">
    <?php
    echo $content;
    ?>
    <div style="clear: both;"></div>
</div><!-- page -->
<div class="bottom">
    <h5><b><?php echo Yii::app()->name; ?> Platform</b> Copyright &copy; <?php echo date('Y'); ?> By Nexttv </h5>
    <h7>
        <small>All Rights Reserved.</small>
    </h7>
</div>
<?php
$autoOpen = false;
if (Yii::app()->user->hasFlash('alert-success') || Yii::app()->user->hasFlash('alert-failure')) {
    $autoOpen = true;
}
$this->beginWidget('bootstrap.widgets.TbModal', array(
    'id' => 'alert',
    'fade' => true,
    'autoOpen' => $autoOpen,
));
?>
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">
                <span aria-hidden="true">×</span>
                <span class="sr-only">Close</span>
            </button>
            <h4 class="modal-title">Message</h4>
        </div>
        <div class="modal-body">
            <?php
            if (Yii::app()->user->hasFlash('alert-success')) {
                $this->widget('bootstrap.widgets.TbAlert', array(
                    'block' => true, // display a larger alert block?
                    'fade' => true, // use transitions?
                    'closeText' => '', // close link text - if set to false, no close link is displayed
                    'alerts' => array( // configurations per alert type
                        'alert-success' => array(
                            'htmlOptions' => array('class' => 'alert-success'),),
                    ),
                ));
            }
            if (Yii::app()->user->hasFlash('alert-failure')) {
                $this->widget('bootstrap.widgets.TbAlert', array(
                    'block' => true, // display a larger alert block?
                    'fade' => true, // use transitions?
                    'closeText' => '', // close link text - if set to false, no close link is displayed
                    'alerts' => array( // configurations per alert type
                        'alert-failure' => array(
                            'htmlOptions' => array('class' => 'alert-danger'),),
                    ),
                ));
            }
            ?>
        </div>
    </div>
</div>
<?php $this->endWidget(); ?>
</body>
</html>
